package com.lighting.common.feign.provider.fall;

import com.lighting.common.core.vo.Result;
import com.lighting.common.feign.provider.client.ProviderClient;
import com.lighting.common.feign.provider.dto.UserDto;
import com.lighting.common.feign.provider.vo.UserVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ProviderClientFallback implements ProviderClient {

    @Override
    public Result<String> test(String msg) {
        log.error("链路日志-spring-boot-log test5555");
        return Result.success("test fallback, please try again.");
    }

    @Override
    public Result<UserVo> getUser(UserDto dto) {
        log.error("链路日志-spring-boot-log test5555");
        UserVo vo = new UserVo();
        vo.setName("王五");
        vo.setAge(20);
        return Result.success(vo);
    }
}